﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HinhAnhControl.ascx.cs"
    Inherits="TMDT.Web.UI.Controls.HinhAnhControl" %>
<asp:MultiView runat="server" ID="mtvView">
    <asp:View runat="server" ID="vInsert">
        <table>
            <tr>
                <td>
                    Tên sản phẩm
                </td>
                <td>
                    <asp:DropDownList ID="ddlSanPham" AutoPostBack="true" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <table class='data-table'>
            <thead>
                <tr>
                    <th>
                        Edit
                    </th>
                    <th>
                        STT
                    </th>
                    <th>
                        IDSanPham
                    </th>
                    <th>
                        URL
                    </th>
                    <td>
                        Delete
                    </td>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater runat="server" ID="rptHinhAnh">
                    <ItemTemplate>
                        <tr class='even'>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnEdit" ImageUrl="~/Images/edit.png" CommandArgument='<%# Eval("IDHinhAnh")%>' />
                            </td>
                            <td>
                                <asp:Label runat="server" ID="lblSTT" Text='<%# Container.ItemIndex + 1 %>'></asp:Label>
                            </td>
                            <td>
                                <%# Eval("IDSanPham") %>
                            </td>
                            <td>
                                <%# Eval("URL") %>
                            </td>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnDelete" ImageUrl="~/Images/delete.png" CommandArgument='<%# Eval("IDHinhAnh")%>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <tr class='odd'>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnEdit" ImageUrl="~/Images/edit.png" CommandArgument='<%# Eval("IDHinhAnh")%>' />
                            </td>
                            <td>
                                <asp:Label runat="server" ID="lblSTT" Text='<%# Container.ItemIndex + 1 %>'></asp:Label>
                            </td>
                            <td>
                                <%# Eval("IDSanPham") %>
                            </td>
                            <td>
                                <%# Eval("URL") %>
                            </td>
                            <td>
                                <asp:ImageButton runat="server" ID="ibnDelete" ImageUrl="~/Images/delete.png" CommandArgument='<%# Eval("IDHinhAnh")%>' />
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
    </asp:View>
    <asp:View runat="server" ID="vUpdate">
        <table>
            <tr>
                <td>
                    Tên sản phẩm
                </td>
                <td>
                    <asp:Label ID="lblTenSanPhamUpdate" runat="server"></asp:Label>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    URL
                </td>
                <td>
                    <asp:FileUpload ID="fupURL" runat="server" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:LinkButton runat="server" ID="lbnUpdate" onclick="lbnUpdate_Click"><span>Update</span></asp:LinkButton>&nbsp;
                    <asp:LinkButton runat="server" ID="lbnCancel" onclick="lbnCancel_Click"><span>Cancel</span></asp:LinkButton>
                </td>
            </tr>
        </table>
    </asp:View>
</asp:MultiView>
